package com.kimho.truckowner.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kimho.truckowner.domain.Truckowner;
import com.kimho.truckowner.persistence.TruckownerMapper;
@Service
public class Truckownerservice {

	@Autowired
	private TruckownerMapper truckownerMapper;
	
	public List<Truckowner> truckownerList(){
		return this.truckownerMapper.truckownerList();
	}
	@Transactional
	public void insertTruckowner(Truckowner truckowner,Map<String,Object> param) {
		//新增物流
		truckownerMapper.insertTruckowner(truckowner);
	}
	@Transactional
	public void deleteTruckowner(Map<String,Object> param) {
		String ids = (String)param.get("ids");
		String[] idsArray = ids.split(",");
		for(int i=0;i<idsArray.length;i++) {
			param.put("id", idsArray[i]);
			truckownerMapper.deleteTruckowner(param);
		}
	}

}
